<?php

/** @var \Laravel\Lumen\Routing\Router $router */

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

$router->get('/', function () use ($router) {
    return response(["data" => $router->app->version(), "message" => "success", "error" => 0]);
});

$router->get('demo/test', ['uses' => 'DemoController@test']);
$router->get('region', ['uses' => 'DemoController@region']);

$router->get('options', ['uses' => 'OptionController@getOptionByName']);
$router->get('option/all', ['uses' => 'OptionController@getOptionAll']);

$router->get('auth/info', ['uses' => 'AuthController@info']);
$router->post('auth/login', ['uses' => 'AuthController@login']);
$router->get('auth/logout', ['uses' => 'AuthController@logout']);

$router->get('company/index', ['uses' => 'CompanyController@index']);
$router->post('company/create', ['uses' => 'CompanyController@create']);
$router->post('company/edit/{id:\d+}', ['uses' => 'CompanyController@edit']);
$router->get('company/{id:\d+}', ['uses' => 'CompanyController@show']);
$router->post('company/add-cert', ['uses' => 'CompanyController@addCertification']);
$router->get('company/agreements', ['uses' => 'CompanyController@getCertificationByCompany']);
$router->post('company/add-cert-detail', ['uses' => 'CompanyController@addCertificationDetail']);

$router->get('certification-detail/index', ['uses' => 'CompanyCertificationDetailController@index']);
$router->get('certification-detail/{id:\d+}', ['uses' => 'CompanyCertificationDetailController@show']);
$router->post('certification-detail/edit/{id:\d+}', ['uses' => 'CompanyCertificationDetailController@edit']);
